<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="admin/layout">
<head>
<title>管理员管理</title>
<script th:inline="javascript">
	/*<![CDATA[*/
	
			/*]]>*/
</script>
</head>
<body>
	<div layout:fragment="content">
		<div class="row">
			<div class="col-md-12">
				<div class="btn-group pull-right">
					<a href="index.html" th:href="@{/admin/safe/operator/index/}"
						id="sample_editable_1_new" class="btn green">返回<i
						class="fa fa-arrow-circle-o-left"></i></a>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<div class="form">
					<form role="form" th:action="@{/admin/safe/operator/save}" th:object="${operator}"
						id="userForm" method="post" class="form-horizontal">
						<h4 class="form-section">管理员信息</h4>
						<input type="hidden" id="operatorId" th:field="*{id}" th:value="${id}"/>
							<div class="form-body">
							<div class="form-group"
								th:class="${#fields.hasErrors('name')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">用户名:<span
									class="required" aria-required="true">* </span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="用户名" th:field="*{name}" id="name" />
							</div>
							</div>
							<div class="form-group"
								th:class="${#fields.hasErrors('password')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">密码:<span
									class="required" aria-required="true">* </span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="密码" th:field="*{password}" />
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-md-3">游戏管理</label>
								<div class="col-md-9">
									<div class="checkbox-list" >
										<label class="checkbox-inline" th:each="gameRecommend : ${gameRecommends}"> 
										<input type="checkbox"   th:field="*{gameRecommendList}"  name="gameRecommend" th:value="${gameRecommend}" th:text="${gameRecommend.description}" id="game_gameRecommend" />
										</label>	
									</div>	
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-md-3">商品管理</label>
								<div class="col-md-9">
									<div class="checkbox-list" >
										<label class="checkbox-inline" th:each="SelectRecommend : ${selectRecommends}"> 
										<input type="checkbox"   th:field="*{selectRecommendList}"  name="selectRecommend" th:value="${SelectRecommend}" th:text="${SelectRecommend.description}" id="prizes_selectRecommend" />
										</label>	
									</div>	
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-md-3">用户管理</label>
								<div class="col-md-9">
									<div class="checkbox-list" >
										<label class="checkbox-inline" th:each="userRecommend : ${userRecommends}"> 
										<input type="checkbox"   th:field="*{userRecommendList}"  name="userRecommend" th:value="${userRecommend}" th:text="${userRecommend.description}" id="user_userRecommend" />
										</label>	
									</div>	
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-md-3">财务管理</label>
								<div class="col-md-9">
									<div class="checkbox-list" >
										<label class="checkbox-inline" th:each="moneyRecommend : ${moneyRecommends}"> 
										<input type="checkbox"   th:field="*{moneyRecommendList}"  name="moneyRecommend" th:value="${moneyRecommend}" th:text="${moneyRecommend.description}" id="money_moneyRecommend" />
										</label>	
									</div>	
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-md-3">安全管理</label>
								<div class="col-md-9">
									<div class="checkbox-list" >
										<label class="checkbox-inline" th:each="safeRecommend : ${safeRecommends}"> 
										<input type="checkbox"   th:field="*{safeRecommendList}"  name="safeRecommend" th:value="${safeRecommend}" th:text="${safeRecommend.description}" id="prizes_selectRecommend" />
										</label>	
									</div>	
								</div>
							</div>


						</div>
						<div class="form-actions fluid">
							<div class="col-md-offset-3 col-md-9">
								<button type="submit" class="btn blue" name="sub">提交</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</body>
</html>



<script th:inline="javascript">
	/*<![CDATA[*/
	
$(document).ready(function(){

		 $("#userForm").validate({
	         rules:{
	        	 name:{
	            	 required:true,
	            	 maxlength:10,
	            	 remote:{
							url:'/admin/safe/operator/verifyName?operatorId='+$('#operatorId').val(),
						}
	             },
	             password:{
	            	 required:true,
	             }
	             
	             
	              
	         },
	         messages:{
	             name:{
	                 required:"请输入属性名称",
	                 remote:'管理员名称重复'
	             },
	             password:{
	                 required:"请输入密码"
	             }
	         }
	         
	     });
	});


	
	/*]]>*/
</script>